// import config from "@/config"
import service from '@/utils/request'
import tool from '@/utils/tool';
import req from '../req';




// 登录
export function login(data) {
  // console.log(data,'data',[data,a]);
  return service({
    url: '/Login',
    method: 'post',
    data: data
  });
}
export function ForgetPassword(data) {
  // console.log(data,'data',[data,a]);
  return service({
    url: '/ForgetPassword',
    method: 'post',
    data: data
  });
}

export function upload() {
  // console.log(data,'data',[data,a]);
  return service({
    url: '/UploadsFile',
    method: 'post',
    headers: { 'Content-Type': 'application/json' }
    // data:data
  });
}
// 获取管理员信息
export function UserInfo(data) {

  var a = {
    client_id: 1,
    api_token: req('Basics/UserInfo'),
    token:tool.data.get("TOKEN")
  }
  console.log(a);
  return service({
    url: 'Basics/UserInfo',
    method: 'post',
    data: { ...data, ...a }
  });
}

// 修改管理员信息
export function UserInfoUpdate(data) {
  var a = {
    client_id: 1,
    api_token: req('Basics/UserInfoUpdate'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Basics/UserInfoUpdate',
    method: 'post',
    data: { ...data, ...a }
  });
}


// 修改项目
export function ProjectUpdate(data) {
  var a = {
    client_id: 1,
    api_token: req('Project/Edit'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Project/Edit',
    method: 'post',
    data: { ...data, ...a }
  });
}

// 获取项目信息
export function getProjectInfo(data) {
  var a = {
    client_id: 1,
    api_token: req('Basics/ProjectList'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Basics/ProjectList',
    method: 'post',
    data: { ...data, ...a }
  });
}

// 添加项目
export function addProject(data) {
  var a = {
    client_id: 1,
    api_token: req('Project/Add'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Project/Add',
    method: 'post',
    data: { ...data, ...a }
  });
}

// 项目群 、 项目列表
export function ProjectList(data) {
  var a = {
    client_id: 1,
    api_token: req('Project/List'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Project/List',
    method: 'post',
    data: { ...data, ...a }
  });
}
// 展示台
export function showcase(data) {
  var a = {
    client_id: 1,
    api_token: req('Project/ProjectDetails'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Project/ProjectDetails',
    method: 'post',
    data: { ...data, ...a }
  });
}
// 用户输入、项目基本信息
export function UserInfosub(data) {
  var a = {
    client_id: 1,
    api_token: req('Interactive/UserInfoSub'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Interactive/UserInfoSub',
    method: 'post',
    data: { ...data, ...a }
  });
}

export function UserRateSub(data) {
  var a = {
    client_id: 1,
    api_token: req('Interactive/UserRateSub'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Interactive/UserRateSub',
    method: 'post',
    data: { ...data, ...a }
  });
}

export function UserCheckinSub(data) {
  var a = {
    client_id: 1,
    api_token: req('Interactive/UserCheckinSub'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Interactive/UserCheckinSub',
    method: 'post',
    data: { ...data, ...a }
  });
}

export function UserRepairSub(data) {
  var a = {
    client_id: 1,
    api_token: req('Interactive/UserRepairSub'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Interactive/UserRepairSub',
    method: 'post',
    data: { ...data, ...a }
  });
}
export function UserDemandSub(data) {
  var a = {
    client_id: 1,
    api_token: req('Interactive/UserDemandSub'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Interactive/UserDemandSub',
    method: 'post',
    data: { ...data, ...a }
  });
}
export function UserContactSub(data) {
  var a = {
    client_id: 1,
    api_token: req('Interactive/UserContactSub'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Interactive/UserContactSub',
    method: 'post',
    data: { ...data, ...a }
  });
}
export function inuserput(data) {
  var a = {
    client_id: 1,
    api_token: req('Interactive/UserInput'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Interactive/UserInput',
    method: 'post',
    data: { ...data, ...a }
  });
}

export function userInputDemand(data) {
  var a = {
    client_id: 1,
    api_token: req('Interactive/UserDemandSub'),
    token:tool.data.get("TOKEN")
  }
  return service({
    url: '/Interactive/UserDemandSub',
    method: 'post',
    data: { ...data, ...a }
  });
}


